package cate.game.common.msg;

import cate.game.GameBody;
import cate.game.client.ClientContext;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgInput;
import cate.game.client.msg.id.MsgIdBCommon;

@ClientMsg(title = "心跳 の 请求")
public class HeartbeatReq implements MsgInput {

    @Override
    public void execute(GameBody game, ClientContext cc) {
        if(cc != null){
            if(cc.getRole() != null){
                cc.getRole().getStatus().active();
            }
            cc.sendNow(new HeartbeatResp(game));
        }
    }

    @Override
    public MsgConfig conf() {
        return MsgIdBCommon.HEART_BEAT_REQ;
    }
}
